import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'; // 需要引入 path 模块

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()], 
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src'), // 将 @ 映射到 src 目录
    },
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://api.provider.w520y.com',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      }
    }
  }
})
